<script setup>
import { ref, onMounted } from 'vue'
const myInpRef = ref(null)
const myBtnRef = ref(null)
onMounted(() => {
  // myInpRef.value.focus()
})
console.log(myBtnRef.value);
onMounted(() => {
  console.log(myBtnRef.value);
})
const clickMe = () => {
  myInpRef.value.focus()
}


</script>

<template>
  <div>
    <input ref="myInpRef" type="text">
    <button ref="myBtnRef" @click="clickMe">点我</button>
  </div>
</template>

<style scoped></style>